﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GameEngineer.Vertex;

namespace GameEngineer.BaseMatrix
{
    public abstract class BaseMatrix
    {
        //矩阵
        protected float[,] mMatrix;
        //行
        protected int mRow = 0;
        //列
        protected int mColumn = 0;      

        public float this[int indexA, int indexB]
        {
            get
            {
                if (this.mRow > indexA && this.mColumn > indexB)
                {
                    return mMatrix[indexA, indexB];
                }
                else
                {
                    Console.WriteLine("矩阵索引错误");
                    return default(float);
                }
            }
            set
            {
                if (this.mRow > indexA && this.mColumn > indexB)
                {
                    mMatrix[indexA, indexB] = value;
                }
                else
                {
                    Console.WriteLine("矩阵索引错误");                    
                }
            }
        }
    }
}
